
import java.sql.Timestamp;


public class Homebase {
	
	
	@Override
	public String toString() {
		return "Homebase [userId=" + userId + ", coordId=" + coordId
				+ ", cityId=" + cityId + ", time=" + time + ", timeLeft="
				+ timeLeft + "]";
	}

	private int userId;
	private int coordId;
	private int cityId;
	private Timestamp time;
	private Long timeLeft;
	
	
	public Homebase()
	{
		this.timeLeft = new Long(0) ;
	}
	
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public int getCoordId() {
		return coordId;
	}
	public void setCoordId(int coordId) {
		this.coordId = coordId;
	}
	public int getCityId() {
		return cityId;
	}
	public void setCityId(int cityId) {
		this.cityId = cityId;
	}
	public Timestamp getTime() {
		return time;
	}
	
	public void setTime(Timestamp time) {
		this.time = time;
		this.timeLeft = Utils.getSixHours() -  (Utils.getTImeNow().getTime() - time.getTime())/1000 ;
		
	}
	
	public Long getTimeLeft()
	{
		return this.timeLeft;
	}
}
